﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using CommonLayer;

namespace EntitiesLayer.ViewModels
{
    public class JobCardViewModel : INotifyPropertyChanged
    {
        public int PartId { get; set; }

        public string PartCode { get; set; }

        public string PartDescription { get; set; }

        private int _quantity;

        public int Quantity
        {
            get { return _quantity; }
            set
            {
                _quantity = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("Quantity"));
            }
        }

        public decimal UnitPrice { get; set; }

        private decimal _value;

        public decimal Value
        {
            get { return _value; }
            set { _value = value;
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs("Value"));
            }
        }


        public decimal VatPrecent { get; set; }

        private decimal _totalAmount;

        public decimal TotalAmount
        {
            get { return _totalAmount; }
            set
            {
                _totalAmount = value; if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("TotalAmount"));
            }
        }

        private string _wcNo;

        public string WCNo
        {
            get { return _wcNo; }
            set { _wcNo = value;
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs("WCNo"));
            }
        }

        private bool _isWCEnabled;

        public bool IsWCEnabled
        {
            get { return _isWCEnabled; }
            set
            {
                _isWCEnabled = value; if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("IsWCEnabled"));
            }
        }


        private bool _isWarrantty;

        public bool IsWarrantty
        {
            get { return _isWarrantty; }
            set { _isWarrantty = value;
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs("IsWarrantty"));
            }
        }

        private List<DDBinding> _priceSource;

        public List<DDBinding> PriceSource
        {
            get { return _priceSource; }
            set
            {
                _priceSource = value; if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("PriceSource"));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
